
import Layout from '@/layout'

// 静态路由
export const constantRouter =  [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  }
]

// 动态路由
export const asyncRouter = [
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    meta:{
      title: 'home',
      icon: 'm-home'
    },
    children: [
      {
        path: 'home',
        component: () => import('@/views/home/index'),
        hidden: true
      },
    ]
  },
  {
    path: '/ucenter',
    component: Layout,
    meta:{
      title: 'ucenter',
      icon: 'm-user'
    },
    children: [
      {
        path: 'group',
        component: () => import('@/views/ucenter/group/index'),
        name: 'group',
        meta: { title: 'group', icon: '' },
      },
      {
        path: 'user',
        component: () => import('@/views/ucenter/user/index'),
        name: 'user',
        meta: { title: 'user', icon: '' },
      },
      {
        path: 'role',
        component: () => import('@/views/ucenter/role/index'),
        name: 'role',
        meta: { title: 'role', icon: '' },
      },
      {
        path: 'domain',
        component: () => import('@/views/ucenter/domain/index'),
        name: 'domain',
        meta: { title: 'domain', icon: '' },
      }
    ]
  },
  {
    path: '/product',
    component: Layout,
    meta:{
      title: 'product',
      icon: 'm-user'
    },
    children: [
      {
        path: 'list',
        component: () => import('@/views/product/list/index'),
        name: 'group',
        meta: { title: 'group', icon: '' },
      },
      {
        path: 'info',
        component: () => import('@/views/product/add/index'),
        name: 'productInfo',
        meta: { title: 'info', icon: '' },
      },
      {
        path: 'compose',
        component: () => import('@/views/product/compose/index'),
        name: 'compose',
        meta: { title: 'info', icon: '' },
      },
      {
        path: 'composeInfo',
        component: () => import('@/views/product/composeAdd/index'),
        name: 'composeInfo',
        meta: { title: 'info', icon: '' },
      },
      {
        path: 'composeProductInfo',
        component: () => import('@/views/product/composeProductAdd/index'),
        name: 'composeProductInfo',
        meta: { title: 'info', icon: '' },
      }
    ]
  },
  {
    path: '/order',
    component: Layout,
    meta:{
      title: 'order',
      icon: 'm-info-management'
    },
    children: [
      {
        path: 'list',
        component: () => import('@/views/order/list/index'),
        name: 'order',
        meta: { title: 'order', icon: '' },
      },
      {
        path: 'auditList',
        component: () => import('@/views/order/auditList/index'),
        name: 'auditList',
        meta: { title: 'auditList', icon: '' },
      },
      {
        path: 'visitDetail',
        component: () => import('@/views/order/visitDetail/index'),
        name: 'visitDetail',
        meta: { title: 'visitDetail', icon: '' },
      }
    ]
  },
  {
    path: '/roi',
    component: Layout,
    meta:{
      title: 'roi',
      icon: 'm-info-management'
    },
    children: [
      {
        path: 'list',
        component: () => import('@/views/roi/list/index'),
        name: 'roi',
        meta: { title: 'roi', icon: '' },
      }
    ]
  }
]
